﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Web.Mvc.Ajax;
using Hotnet.Biz.NSBizVideo;
using Hotnet.Entity;
using Ninject.Core;

namespace Hotnet.Web.Controllers.Admin
{
	public class AdminVideoCategoryController : AdminBaseController
	{
		//
		// GET: /AdminVideoCategory/
		private BizVideoCategory bizVideoCategory { get; set; }

		public AdminVideoCategoryController(BizVideoCategory bizVideoCategory)
		{
			this.bizVideoCategory = bizVideoCategory;
		}

		public ActionResult Index()
		{
			VideoCategory[] list = bizVideoCategory.List();
			return View(list);
		}

		//
		// POST: /AdminVideoCategory/Create

		[AcceptVerbs(HttpVerbs.Post)]
		public ActionResult Create(VideoCategory model)
		{
			bizVideoCategory.Insert(model);
			return RedirectToAction("Index");
		}


		//
		// POST: /AdminVideoCategory/Edit/5

		[AcceptVerbs(HttpVerbs.Post)]
		public ActionResult Edit(VideoCategory model)
		{
			bizVideoCategory.Update(model);
			return RedirectToAction("Index");
		}

		[AcceptVerbs(HttpVerbs.Post)]
		public ActionResult Delete(int? id)
		{
			bizVideoCategory.Delete(id ?? 0);
			return RedirectToAction("Index");
		}

	}
}
